package com.cesgroup.zw.spring.boot.library.echarts.bar.complex;

import com.cesgroup.zw.spring.boot.echarts.build.EChartsOption;
import com.cesgroup.zw.spring.boot.echarts.component.AxisPointer;
import com.cesgroup.zw.spring.boot.echarts.component.Grid;
import com.cesgroup.zw.spring.boot.echarts.component.axis.XAxis;
import com.cesgroup.zw.spring.boot.echarts.component.axis.YAxis;
import com.cesgroup.zw.spring.boot.echarts.enums.AxisPointerType;
import com.cesgroup.zw.spring.boot.echarts.enums.AxisType;
import com.cesgroup.zw.spring.boot.echarts.model.axis.AxisLabel;
import com.cesgroup.zw.spring.boot.echarts.model.axis.AxisLine;
import com.cesgroup.zw.spring.boot.echarts.model.axis.SplitLine;
import com.cesgroup.zw.spring.boot.echarts.model.style.LineStyle;

/**
 * <p>柱状图表</p>
 * @author ytj
 * @date 2019/7/4 9:29
 */
public class ComplexBarOption extends EChartsOption{
    public ComplexBarOption(ComplexBarParam param){
        this.setBackgroundColor("#18163B");
        this.setGrid(new Grid(){{
            this.setTop("15%");
            this.setRight("3%");
            this.setLeft("5%");
            this.setBottom("12%");
        }});
        this.setXAxis(new XAxis(){{
            this.setType(AxisType.category);
            this.setAxisPointer(new AxisPointer(){{
                this.setType(AxisPointerType.line);
            }});
            this.setAxisLine(new AxisLine(){{
                this.setLineStyle(new LineStyle(){{
                    this.setColor("#272456");
                }});
            }});
            this.setAxisLabel(new AxisLabel(){{
                this.setMargin(20);
                this.setColor("#59588D");
            }});
        }});
        this.setYAxis(new YAxis(){{
            this.setMin(0);
            this.setMax(100);
            this.setAxisLabel(new AxisLabel(){{
                this.setFormatter("{value}%");
                this.setColor("#59588D");
            }});
            this.setAxisLine(new AxisLine(){{
                this.setShow(false);
            }});
            this.setSplitLine(new SplitLine(){{
                this.setLineStyle(new LineStyle(){{
                    this.setColor("#272456");
                }});
            }});
        }});
    }
}
